<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>鼠标事件</title>
    <style>
        #outer{
            width: 300px;
            height: 300px;
            background-color: #ccc;
        }
    </style>
</head>
<body>
    <div id="outer">

    </div>
    <script>
        //1. 单击,双击

        //2. 鼠标移上去,按下去,离开
        let outer = document.getElementById("outer");
        outer.onmouseover=function(){
            outer.style.backgroundColor="red";
        }
        outer.onmouseleave=function(){
            outer.style.backgroundColor="#ccc";
        }
        outer.onmousedown=function(){
            outer.style.backgroundColor="yellow";
        }
        outer.onmouseup=function(){
            outer.style.backgroundColor="blue";
        }
    </script>
</body>
</html>